# -*- coding: utf-8 -*-
# @Time    : 2023/2/21 19:21
# @Author  : HeAlec
# @FileName: test.py
# @Desc: description
# @blogs ：https://segmentfault.com/u/alec_5e8962e4635ca
import openai

openai.api_key = "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"

prompt = "你的问题"
response = openai.Completion.create(
    engine="text-davinci-003",  # 慢，模型大、能力强
    # engine="text-curie-001", # 较快
    # engine="text-babbage-001",
    # engine="text-ada-001", # 最快
    prompt=prompt,
    max_tokens=1024,  # 编码长度
    n=1,  # 候选答案数量
    temperature=1,
)
for answer in response["choices"]:
    print(answer["text"])
